package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._17单例模式._4基本代码;

//单例模式类
class Singleton {

    private static Singleton instance = new Singleton();

    //构造方法private化
    private Singleton() {
    }

    //得到Singleton的实例（唯一途径） 饿汉式，初始化直接new
    public static Singleton getInstance() {
        return instance;
    }
}
